// 引入 request
import request from '_utils/request'

// 定义一个请求商品列表函数
const fetchItems = (params = {}) => request.get('/getItemLists', { params })
// 增加商品
const addItems = (params = {}) => request.post('/addItem', params)
// 获取商品详情
const fetchItemDetail = (id) => request.get('/getItemDetail', { params: { id } })
// 更新商品
const updateItems = (params = {}) => request.put('/updateItem', params)
// 登录
const doLogin = (params = {}) => request.post('/login', params)
// 删除商品
const delItem = (id) => request.delete('/delItem', { params: { id } })
export {
  fetchItems,
  addItems,
  fetchItemDetail,
  updateItems,
  doLogin,
  delItem
}
